package com.qiangesoft.datasourcembpd.controller;

import com.qiangesoft.datasourcembpd.entity.BcgDataSource;
import com.qiangesoft.datasourcembpd.service.IBcgDataSourceService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 数据源 前端控制器
 * </p>
 *
 * @author qiangesoft
 * @since 2024-03-13
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/datasource")
public class BcgDataSourceController {

    private final IBcgDataSourceService dataSourceService;

    @GetMapping("/changeDs")
    public List<BcgDataSource> changeDataSource(String dataSourceId) {
        return dataSourceService.changeDataSource(dataSourceId);
    }

    @GetMapping("/changeDs1")
    public List<BcgDataSource> changeDataSource1() {
        return dataSourceService.changeDataSourceByAnnotation();
    }

}
